package com.keshihao.cmsservice.controller;

import com.keshihao.cmsservice.entity.CrmBanner;
import com.keshihao.cmsservice.service.CrmBannerService;
import com.keshihao.commonutils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Mr.Keshihao
 * @Date 2020/6/15 10:03
 * @Version 1.0
 */
@CrossOrigin
@RestController
@RequestMapping("/cmsservice/bannerfront")
public class BannerFrontController {

  @Autowired
  private CrmBannerService bannerService;

  @ApiOperation(value = "获取首页banner")
  @GetMapping("/getAllBanner")
  public R getAllBanner() {
    List<CrmBanner> list = bannerService.selectAllBanner();
    return R.ok().data("bannerList", list);
  }

}
